namespace IMPlant.Core.Web.Control.GridViewFunction
{
    using IMPlant.Core.Web.Control;
    using System;

    public abstract class ExtendFunction
    {
        protected IMPlant.Core.Web.Control.GridView _grid;

        public ExtendFunction()
        {
        }

        public ExtendFunction(IMPlant.Core.Web.Control.GridView gv)
        {
            this._grid = gv;
        }

        public void Complete()
        {
            if (this._grid == null)
            {
                throw new ArgumentNullException("GridView", "扩展功能时未设置GridView对象");
            }
            this.Execute();
        }

        protected abstract void Execute();

        public IMPlant.Core.Web.Control.GridView GridView
        {
            get
            {
                return this._grid;
            }
            set
            {
                this._grid = value;
            }
        }
    }
}

